package com.kjj.gift.clients;

import com.kjj.gift.dto.RegisterPhoneValidateDto;
import com.kjj.gift.dto.SMSCodeDto;
import com.kjj.gift.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import javax.validation.Valid;

@Component
public class SmsValidateCodeClientFallbackFactory implements FallbackFactory<SmsValidateCodeClient> {
    @Override
    public SmsValidateCodeClient create(Throwable throwable) {
        return new SmsValidateCodeClient() {
            @Override
            public AjaxResult sendSmsCode(@Valid SMSCodeDto smsCodeDto) {
                throwable.getStackTrace();
                return null;
            }

            @Override
            public AjaxResult validateRegisterCode(RegisterPhoneValidateDto dto) {
                throwable.getStackTrace();
                return null;
            }
        };
    }
}
